package com.itheima.tlias84.controller;

import com.itheima.tlias84.Service.EmpService;
import com.itheima.tlias84.Service.StudentService;
import com.itheima.tlias84.Util.ResultUtil;
import com.itheima.tlias84.dto.ReportEmpGenderDTO;
import com.itheima.tlias84.dto.SelectStudentDegreeDataDTO;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/report")
public class ReportController {
    @Resource
    EmpService empService;
    @Resource
    StudentService service;

    @GetMapping("empGenderData")
    public ResultUtil countEmpByGender() {
        List<ReportEmpGenderDTO> dtos = empService.countEmpByGender();
        return ResultUtil.success(dtos);

    }
    @GetMapping("empJobData")
    public ResultUtil countEmpJob() {
        ResultUtil resultUtil = empService.countEmpJob();
        return resultUtil;
    }
    @GetMapping("/studentDegreeData")
    public ResultUtil selectStudentDegreeData(){
        List<SelectStudentDegreeDataDTO> list = service.selectStudentDegreeData();
        return ResultUtil.success(list);
    }
    @GetMapping("/studentCountData")
    public ResultUtil selectStudentCountData(){
        ResultUtil resultUtil = service.selectStudentCount();
        return resultUtil;
    }




}
